//
//  MDHMacroHeader.h
//  MDHPT
//
//  Created by 高得华 on 2019/4/24.
//  Copyright © 2019年 高得华. All rights reserved.
//

#import "MDHMacro.h"

/// com.CatAccompany    com.mmw.MDHPT1

/// 偏好设置
#define MDHUserDefaults [NSUserDefaults standardUserDefaults]
/// 存储language
static NSString * const MHPreferenceSettingLanguage = @"MHPreferenceSettingLanguage";

/// 存储看一看
static NSString * const MHPreferenceSettingLook = @"MHPreferenceSettingLook";
/// 存储看一看（全新）
static NSString * const MHPreferenceSettingLookArtboard = @"MHPreferenceSettingLookArtboard";

/// 存储搜一搜
static NSString * const MHPreferenceSettingSearch = @"MHPreferenceSettingSearch" ;
/// 存储搜一搜（全新）
static NSString * const MHPreferenceSettingSearchArtboard = @"MHPreferenceSettingSearchArtboard" ;


/// ---- 新消息通知
/// 接收新消息通知
static NSString * const MHPreferenceSettingReceiveNewMessageNotification = @"MHPreferenceSettingReceiveNewMessageNotification";
/// 接收语音和视频聊天邀请通知
static NSString * const MHPreferenceSettingReceiveVoiceOrVideoNotification = @"MHPreferenceSettingReceiveVoiceOrVideoNotification";
/// 视频聊天、语音聊天铃声
static NSString * const MHPreferenceSettingVoiceOrVideoChatRing = @"MHPreferenceSettingVoiceOrVideoChatRing" ;
/// 通知显示消息详情
static NSString * const MHPreferenceSettingNotificationShowDetailMessage = @"MHPreferenceSettingNotificationShowDetailMessage" ;
/// 消息提醒铃声
static NSString * const MHPreferenceSettingMessageAlertVolume = @"MHPreferenceSettingMessageAlertVolume";
/// 消息提醒震动
static NSString * const MHPreferenceSettingMessageAlertVibration = @"MHPreferenceSettingMessageAlertVibration";


/// ---- 设置消息免打扰
static NSString * const MHPreferenceSettingMessageFreeInterruption = @"MHPreferenceSettingMessageFreeInterruption" ;

/// ---- 隐私
/// 加我为朋友时需要验证
static NSString * const MHPreferenceSettingAddFriendNeedVerify = @"MHPreferenceSettingAddFriendNeedVerify";
/// 向我推荐通讯录朋友
static NSString * const MHPreferenceSettingRecommendFriendFromContactsList = @"MHPreferenceSettingRecommendFriendFromContactsList";
/// 允许陌生人查看十条朋友圈
static NSString * const MHPreferenceSettingAllowStrongerWatchTenMoments = @"MHPreferenceSettingAllowStrongerWatchTenMoments";
/// 开启朋友圈入口
static NSString * const MHPreferenceSettingOpenFriendMomentsEntrance = @"MHPreferenceSettingOpenFriendMomentsEntrance";
/// 朋友圈更新提醒
static NSString * const MHPreferenceSettingFriendMomentsUpdateAlert = @"MHPreferenceSettingFriendMomentsUpdateAlert";

/// ---- 通用
/// 听筒模式
static NSString * const MHPreferenceSettingReceiverMode = @"MHPreferenceSettingReceiverMode";

///协议类
//#import "MDHPTProtocol.h"
///基础的 ViewModel
#import "MDHViewModel.h"
///视频的临时文件的缓存名称
static NSString * _Nullable const MDHPT_MMW_TEMPVideo_NAME = @"MDHPT_MMW_TEMPVideo_NAME";
/// 存储应用版本的key
static NSString * _Nullable const MHApplicationVersionKey = @"SBApplicationVersionKey";
/// 用户信息的名称
static NSString * const MHUserDataFileName = @"senba_empty_user.data";



/// 私钥key
static NSString *const MHHTTPServiceKey = @"privatekey";
/// The Http request error domain
static NSString *const MHHTTPServiceErrorDomain = @"MHHTTPServiceErrorDomain";

/// 连接服务器失败 default
static NSInteger const MHHTTPServiceErrorConnectionFailed = 668;
static NSInteger const MHHTTPServiceErrorJSONParsingFailed = 669;

static NSInteger const MHHTTPServiceErrorBadRequest = 670;
static NSInteger const MHHTTPServiceErrorRequestForbidden = 671;
/// 服务器请求失败
static NSInteger const MHHTTPServiceErrorServiceRequestFailed = 672;
static NSInteger const MHHTTPServiceErrorSecureConnectionFailed = 673;

static NSString * const MHHTTPServiceErrorRequestURLKey = @"MHHTTPServiceErrorRequestURLKey";
static NSString * const MHHTTPServiceErrorHTTPStatusCodeKey = @"MHHTTPServiceErrorHTTPStatusCodeKey";
static NSString * const MHHTTPServiceErrorDescriptionKey = @"MHHTTPServiceErrorDescriptionKey";
static NSString * const MHHTTPServiceErrorMessagesKey = @"MHHTTPServiceErrorMessagesKey";

//MARK: - ==== 通知方面
///登录成功 通知 /// 用户数据配置完成
static NSString * _Nullable const kNotification_LoginSuccess  = @"kNotification_LoginSuccess";
/// 用户数据配置完成，取出userInfo 数据的的key
static NSString * const MHUserDataConfigureCompleteUserInfoKey = @"MHUserDataConfigureCompleteUserInfoKey";
///聊天室的缩小
static NSString * _Nullable const kNotificationName_ChatroomSmallWidow = @"kNotificationName_ChatroomSmallWidow";
///音频不在使用
static NSString * _Nullable const kNotficationName_MDHUseAudioTYPENoUse = @"kNotficationName_MDHUseAudioTYPENoUse";

/// 全局分割线高度 .5
static CGFloat const MHGlobalBottomLineHeight = 0.5f;


//MARK: - ===== 枚举
///请求数据返回的状态码
typedef NS_ENUM(NSUInteger, MHHTTPResponseCode) {
    MHHTTPResponseCodeSuccess = 200,                     /// 请求成功
    MHHTTPResponseCodeNotLogin = 666,                     /// 用户尚未登录
    MHHTTPResponseCodeParametersVerifyFailure = 105,      /// 参数验证失败
};

///按钮中图片的位置
typedef NS_ENUM(NSInteger, MMWDHButtonImageAlignment) {
    ///图片在左，默认
    MMWDHButtonImageAlignmentLeft = 0,
    ///图片在上
    MMWDHButtonImageAlignmentTop = 1,
    ///图片在下
    MMWDHButtonImageAlignmentBottom = 2,
    ///图片在右
    MMWDHButtonImageAlignmentRight = 3,
};

////数据处理后需要进行的操作标识
typedef NS_ENUM(NSInteger, LSRefreshDataStatus) {
    ///下拉还有更多数据
    LSHeaderRefresh_HasMoreData = 1,
    ///下拉没有更多数据
    LSHeaderRefresh_HasNoMoreData,
    ///上拉还有更多数据
    LSFooterRefresh_HasMoreData,
    ///上拉没有更多数据
    LSFooterRefresh_HasNoMoreData,
    ///刷新出错
    LSRefreshError,
    ///仅仅刷新UI布局
    LSRefreshUI,
    ///没有数据
    LSRefreshNoData,
    ///缓存数据
    LSRefreshCache,
};

#import "MDHFileConstant.h"
#import "MHFileManager.h"

///网络图片的占位图片
static inline UIImage * MDHWebImagePlaceholder() {
    return [UIImage imageNamed:@"refresh_1"];
}

///网络头像
static inline UIImage *MDHWebAvatarImagePlaceholder() {
    return [UIImage imageNamed:@"refresh_1"];
}

///音乐方面的网络占位图 music_moren_yinyue
static inline UIImage *MDHWebMusicAvatarPlaceholder() {
    return [UIImage imageNamed:@"refresh_1"];
}

///动态上下之间的间距 内容（控件）之间的的间距 10
static inline CGFloat MHMomentContentInnerMargin() {
    return 10*kMDHPTAutoScale();
}

/// 辅助方法 创建一个文件夹
static inline void MHCreateDirectoryAtPath(NSString *path) {
    [MHFileManager createDirectoryAtPath:path];
    /*BOOL isDir = NO;
    BOOL isExist = [[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDir];
    if (isExist) {
        if (!isDir) {
            [[NSFileManager defaultManager] removeItemAtPath:path error:nil];
            [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
        }
    } else {
        [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
    }*/
}
/// 微信重要数据备份的文件夹路径，通过NSFileManager来访问
static inline NSString *MHWeChatDocDirPath() {
    return [[MHFileManager appDocumentDirectoryPath] stringByAppendingPathComponent:MDHPT_MMW_DOC_NAME];
}
/// 通过NSFileManager来获取指定重要数据的路径
static inline NSString *MHFilePathFromWeChatDoc(NSString *filename) {
    NSString *docPath = MHWeChatDocDirPath();
    MHCreateDirectoryAtPath(docPath);
    return [docPath stringByAppendingPathComponent:filename];
}

/// 微信轻量数据备份的文件夹路径，通过NSFileManager来访问
static inline NSString *MHWeChatCacheDirPath() {
    return [[MHFileManager appCachesDirectoryPath] stringByAppendingPathComponent:MDHPT_MMW_CACHE_NAME];
}
/// 通过NSFileManager来访问 获取指定轻量数据的路径
static inline NSString *MHFilePathFromWeChatCache(NSString *filename) {
    NSString *cachePath = MHWeChatCacheDirPath();
    MHCreateDirectoryAtPath(cachePath);
    return [cachePath stringByAppendingPathComponent:filename];
}

NS_ASSUME_NONNULL_BEGIN
@interface MDHMacroHeader : NSObject



@end
NS_ASSUME_NONNULL_END
